import Vue from "vue";

import TDesign from "tdesign-vue";
import "tdesign-vue/es/style/index.css";

import "normalize.css/normalize.css";
import "@/styles/global.css";

import pagination from "@/components/menuComponent/pagination.vue";
import networkSelect from "@/components/menuComponent/NetworkSelect.vue";
import elltable from "@/components/menuComponent/Elltable";
import czbtn from "@/components/menuComponent/resetbtn";
import dateymd from "@/components/menuComponent/dateymd";
// 导入组件
import Score from "@/components/Echarts/Score";
import Bar from "@/components/Echarts/Bar";
import Star from "@/components/Echarts/Star";
import SelectMonth from "@/components/Echarts/SelectMonth";
import Doughnut from "@/components/Echarts/Doughnut";
import Annulus from "@/components/Echarts/Annulus";
import BrokenColumn from "@/components/Echarts/BrokenColumn";
import SelectNetwork from "@/components/Echarts/SelectNetwork";
import LinearGradient from "@/components/Echarts/LinearGradient";
import SelectMonthLight from "@/components/Echarts/SelectMonthLight";
import Stack from "@/components/Echarts/Stack";
import Rose from "@/components/Echarts/Rose";
import SelectDateRange from "@/components/Echarts/SelectDateRange";
import Empty from "@/components/menuComponent/empty.vue";
import EditableTable from "@/components/EditableTable.vue";

// main.js文件中引入并全局注册
import * as echarts from "echarts";
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import dayjs from "dayjs";
import "@/styles/index.scss"; // global css
import Mixin from "./mixins";
import App from "./App";
import store from "./store";
import router from "./router";

import "@/icons"; // icon
import "@/permission"; // permission control
// 将hasBP函数挂载到vue原型上
import hasBtnPermission from "@/utils/hasBP";
Vue.prototype.$hasBP = hasBtnPermission;
Vue.prototype.echarts = echarts;
Vue.prototype.$dayJs = dayjs;
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(echarts);
Vue.use(TDesign);
Vue.component("pagination", pagination);
Vue.component("netselect", networkSelect);
Vue.component("elltable", elltable);
Vue.component("elbutton", czbtn);
Vue.component("dateymd", dateymd);

Vue.component("Score", Score);
Vue.component("Bar", Bar);
Vue.component("StarRate", Star);
Vue.component("SelectMonth", SelectMonth);
Vue.component("Doughnut", Doughnut);
Vue.component("Annulus", Annulus);
Vue.component("BrokenColumn", BrokenColumn);
Vue.component("SelectNetwork", SelectNetwork);
Vue.component("LinearGradient", LinearGradient);
Vue.component("SelectMonthLight", SelectMonthLight);
Vue.component("Stack", Stack);
Vue.component("Rose", Rose);
Vue.component("SelectDateRange", SelectDateRange);
Vue.component("Empty", Empty);
Vue.component("EditableTable", EditableTable);

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

Vue.mixin(Mixin);
Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: (h) => h(App),
});
